/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.toto.loginAccount;

import com.toto.loginAccount.object.Login;
import javax.ejb.CreateException;
import javax.ejb.EJBException;
import javax.ejb.EntityBean;
import javax.ejb.EntityContext;
import javax.ejb.RemoveException;

/**
 *
 * @author Administrator
 */
public abstract class LoginBean implements EntityBean
{
  private EntityContext entityContext;
  public abstract String getUserId();
  public abstract void setUserId(String userId);
  
  public abstract String getName();
  public abstract void setName(String name);

  public abstract String getPassword();
  public abstract void setPassword(String password);

  public abstract String getPermission();
  public abstract void setPermission(String permission);

  public void setEntityContext(EntityContext ctx) throws EJBException
  {
    this.entityContext = ctx;
  }

//  public String ejbCreate(Login login) throws CreateException
//  {
//    setUserId(login.getUserId());
//    setName(login.getName());
//    setPassword(login.getPassword());
//    setPermission(login.getPermission());
//    return null;
//  }
  public String ejbCreate(String userId, String name, String password, String permission) throws CreateException
  {
      setUserId(userId);
      setName(name);
      setPassword(password);
      setPermission(permission);
      return null;
  }
//  public void ejbPostCreate(Login login)
//  {
//  }
  public void ejbPostCreate(String userId, String name, String password, String permission)
  {
  }

  public void unsetEntityContext() throws EJBException
  {
      this.entityContext = null;
  }

  public void ejbRemove(String userId) throws RemoveException, EJBException
  {
  }

  public void ejbActivate() throws EJBException
  {
  }

  public void ejbPassivate() throws EJBException
  {
  }

  public void ejbLoad() throws EJBException
  {
  }

  public void ejbStore() throws EJBException
  {
  }

}
